package com.example.spring.web.demo.controller;

import com.example.spring.web.demo.service.TestService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @ClassName TestController
 * @Description
 * @Author lichuanqi
 * @Date 2021/11/18 17:45
 * @Version 1.0
 **/
@RestController
@RequestMapping("/test")
public class TestController {
    @Resource
    private TestService testService;
    @GetMapping("/sayHello")
    public String sayHello(String name){
        return testService.sayHello(name);
    }

    @GetMapping("/add")
    public Integer add(Integer arg1, Integer arg2){
        return testService.add(arg1,arg2);
    }

    @GetMapping("/sleep")
    public String sleep(Integer seconds){
        return testService.sleep(seconds);
    }
}
